package com.wang.service.Impl;

import com.wang.dao.ExpertMajorEntityDao;
import com.wang.dao.ExpertTypeEntityDao;
import com.wang.domain.ExpertMajorEntity;
import com.wang.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/2/11 0011.
 */
@Service
public class ExpertMajorServiceImpl implements IService<ExpertMajorEntity> {
    @Autowired
    private ExpertMajorEntityDao expertMajorDao;


    @Override
    public Page<ExpertMajorEntity> findAll() {
        return expertMajorDao.findAll(new PageRequest(0,Integer.MAX_VALUE, Sort.Direction.ASC,"id"));
    }

    @Override
    public ExpertMajorEntity add(ExpertMajorEntity entity) {
        return expertMajorDao.save(entity);
    }

    @Override
    public ExpertMajorEntity edit(ExpertMajorEntity entity) {
        return expertMajorDao.save(entity);
    }

    @Override
    public void delete(ExpertMajorEntity entity) {
        expertMajorDao.delete(entity);
    }
}
